import request from '@/utils/request'
/**
 * login func
 * parameter: {
 *     username: '',
 *     password: '',
 *     remember_me: true,
 *     captcha: '12345'
 * }
 * @param parameter
 * @returns {*}
 */

export function GetUrlList(data) {
  return request({
    url: '/api/file/downloadInfos',
    method: 'post',
    data: data,
    needToken: true,
  })
}

// 上传文件
export function Upload(data) {
  return request({
    url: '/api/file/add',
    method: 'post',
    data: data,
    needToken: true,
    headers: { 'content-type': 'multipart/form-data' },
  })
}

export function GetMap(parameter) {
  return request({
    url: '/api/file/get',
    method: 'get',
    params: parameter,
    needToken: true,
  })
}

export function Delete(parameter) {
  return request({
    url: '/api/file/delete',
    method: 'delete',
    params: parameter,
    needToken: true,
  })
}

// 下载文件信息(获取下载链接)
export function DownloadInfo(parameter) {
  return request({
    url: '/api/file/downloadInfo',
    params: parameter,
    method: 'get',
    needToken: true,
  })
}
